package com.ics.atable.chat.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 聊天会话表
 *
 * @author haohongbin
 */
@Data
@TableName(value ="chat_session")
public class ChatSession implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 会话ID（UUID）
     */
    @TableId(value = "id")
    private String id;

    /**
     * 会话标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 状态：active-活跃，archived-归档，deleted-已删除
     */
    @TableField(value = "status")
    private String status;

    /**
     * 是否置顶：0-否，1-是
     */
    @TableField(value = "is_pinned")
    private Integer isPinned;

    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date updateTime;
}
